//
//  LGCemeteryHomeTableViewCell.m
//  ligenyun
//
//  Created by Mac on 2018/4/9.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGCemeteryHomeTableViewCell.h"

@interface  LGCemeteryHomeTableViewCell()
@property(nonatomic, strong) UIImageView                     *bannerImageView;
@property(nonatomic, strong) STLabel                     *titleLable;
@property(nonatomic, strong) STLabel                     *moneyLable;

@end
@implementation LGCemeteryHomeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 130;
}
#pragma mark --subView
- (void)configSubView{
    self.bannerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 115, 100)];
    self.bannerImageView.image = [UIImage imageNamed:@"纪念馆01"];
    [self addSubview:self.bannerImageView];
    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.bannerImageView.right  +10, self.bannerImageView.top, UIScreenWidth - 20 - self.bannerImageView.right, 40)
                                                     text:@"宋庆龄陵园现在官方明明人中华人名工俄国名誉主席宋庆龄"
                                                textColor:FirstTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.titleLable];
    

    STLabel * lable1 = [self lableFormTitle:@"好闪"];
    lable1.top = self.titleLable.bottom;
    lable1.left = self.bannerImageView.right + 10;
    [self addSubview:lable1];
    
    STLabel * lable2 = [self lableFormTitle:@"好水"];
    lable2.top = self.titleLable.bottom;
    lable2.left = lable1.right + 10;
    [self addSubview:lable2];
    
    STLabel * lable3 = [self lableFormTitle:@"好风光"];
    lable3.top = self.titleLable.bottom;
    lable3.left = lable2.right + 10;
    [self addSubview:lable3];
    
    self.moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(self.bannerImageView.right  +10, lable3.bottom + 10, UIScreenWidth - 20 - self.bannerImageView.right, 40)
                                                text:@"￥300"
                                           textColor:TM_redColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.moneyLable];
    
    self.lookButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 70, 30)
                                                     title:@"查看地图"
                                                titleColor:[UIColor whiteColor]
                                                 titleFont:14
                                              cornerRadius:4
                                           backgroundColor:TM_redColor
                                           backgroundImage:nil
                                                     image:nil];
    self.lookButton.right = UIScreenWidth - 10;
    self.lookButton.centerY = self.moneyLable.centerY;
    self.lookButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [self addSubview:self.lookButton];
    
}
- (STLabel*)lableFormTitle:(NSString*)title{
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)
                                                     text:title
                                                textColor:FirstTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    titleLable.backgroundColor = TM_buttonBackGroundColor;
    [NSString lableAutoAdjustWitdhWithLabel:titleLable];
    titleLable.width = titleLable.width + 20;
    titleLable.layer.cornerRadius = 4;
    titleLable.clipsToBounds = YES;
    return titleLable;
}
@end
